/**
 * type 
 *  0 账号密码登录
 *  1 手机验证码登录
 * /*
 * 
 */  
LOGINTYPE = {
    PHONECODELOGINREDISTER          : 0,        //手机验证码（注册|登录
    PHONEPASSWORDREGISTER           : 1,        //手机账号，密码注册
    PHONEPASSWORDREGISTERLOGIN      : 2,        //手机账号、密码注册登录
    WXLOGINREGISTER                 : 3,        //微信注册、登录
    QQLOGINREGISTER                 : 4,        //QQ注册、登录
};

//手机号登录
WebCenter.loginGameByPhone = function(phone,passwoord,callback,type){
    if(type == LOGINTYPE.PHONECODELOGINREDISTER){                 
        var mark = 350;
    }else if(type == LOGINTYPE.PHONEPASSWORDREGISTER){           
        var mark = 352;
    }else if(type == LOGINTYPE.PHONEPASSWORDREGISTERLOGIN){       
        var mark = 351;
    }
    var url = PHP_HOME+"/UserFunc.php?&GetMark="+mark+"&PhoneNumbers="+phone+"&LogonPass=" +  hex_md5(passwoord);
    WebCenter.GetData(url,null,callback);
},

//微信QQ登录
WebCenter.loginGameByWXQQ = function(obj,callback,type){
    if(type == LOGINTYPE.WXLOGINREGISTER){                 
        var mark = 11;
    }else if(type == LOGINTYPE.QQLOGINREGISTER){           
        var mark = 300;
    }
    var openid = obj.openid;
    var nickname = obj.nickname;
    var sex = obj.sex;
    var headimgurl = obj.headimgurl;
    var url = PHP_HOME+"/UserFunc.php?&GetMark="+mark+ "&openid="+openid+"&nickname="+nickname+"&sex="+sex+"&headimgurl="+headimgurl;
    WebCenter.GetData(url,null,callback);
},

/**
 * 获取验证码
 * @param {  Res ：1成功，0失败
    RandNum ：4位随机验证码} phone 
 * @param {*} passwoord 
 * @param {*} callback 
 * @param {*} type 
 */
WebCenter.getPhoneCode = function(phone,callback){
    var url = PHP_HOME+"/UserFunc.php?&GetMark=3&PhoneNumbers="+phone+"&SignName=美萝网络&TemplateCode=SMS_182470200";
    WebCenter.GetData(url,null,callback);
}
          